package wire

import (
	"github.com/google/wire"

	"gitee.com/krio/grpc-go-server/dao/logic/region"
	"gitee.com/krio/grpc-go-server/dao/logic/user"
	"gitee.com/krio/grpc-go-server/internal/dependency"
)

var (
	// 公共内容
	ProviderSet = wire.NewSet(
		wire.Struct(new(user.UserDao), "*"),
		wire.Struct(new(region.CountryDao), "*"),
		wire.Struct(new(user.UserLoginDao), "*"),
		wire.Struct(new(user.UserEduDao), "*"),
		wire.Struct(new(user.UserInfoDao), "*"),
		wire.Struct(new(region.RegionDao), "*"),

		// 接口绑定
		wire.Bind(new(dependency.UserRepository), new(*user.UserDao)),
		wire.Bind(new(dependency.UserEduRepository), new(*user.UserEduDao)),
		wire.Bind(new(dependency.UserInfoRepository), new(*user.UserInfoDao)),
		wire.Bind(new(dependency.UserLoginRepository), new(*user.UserLoginDao)),
		wire.Bind(new(dependency.CountryRepository), new(*region.CountryDao)),
		wire.Bind(new(dependency.RegionRepository), new(*region.RegionDao)),
	)
)
